#ifndef __DEF_ACCOUNTDIALOG_H__
#define __DEF_ACCOUNTDIALOG_H__

#include <wx/wx.h>
#include <wx/spinctrl.h>
#include <wx/wxsqlite3.h>
#include "appconstant.h"
#include "dbkakeibo.h"
#include <vector>

class AccountDialog: public wxDialog
{
public:
	AccountDialog(wxWindow *parent);
	~AccountDialog(void) {};
	
	void BindData_Account(wxSQLite3ResultSet &table);
	std::vector<DB_account> GetChangedData(modifyType mt = none_mt);
	void ClearControl(void) {
		ac_InputAccountName->Clear();
		ac_InitialRemainder->SetValue(0);
	}
protected:
	wxListBox *ac_AccountList;
	wxButton *ac_AddAccount;
	wxButton *ac_ModAccount;
	wxButton *ac_DelAccount;
	wxStaticBox *ac_AccountInfo;
		wxTextCtrl *ac_InputAccountName;
		wxSpinCtrl *ac_InitialRemainder;
	
	wxButton *ac_OkBtn;
	wxButton *ac_CanBtn;

	void ac_AddAccount_clicked(wxCommandEvent &event);
	void ac_ModAccount_clicked(wxCommandEvent &event);
	void ac_DelAccount_clicked(wxCommandEvent &event);
	void ac_AccountList_selected(wxCommandEvent &event);

	void ac_OkBtn_clicked(wxCommandEvent &event);
	void ac_CanBtn_clicked(wxCommandEvent &event);

private:
	DECLARE_EVENT_TABLE()

	std::vector<DB_account> dbaccount;

};

enum {
	account_ok = 200,
	account_can,
	account_add,
	account_mod,
	account_del,
	account_list

};
#endif